﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CapaDeDominio;
using System.Data.Entity.ModelConfiguration;

namespace CapaDeDatos.EF.ORM
{
    public class LocalMapping : EntityTypeConfiguration<Local>
    {
        public LocalMapping()
            : base()
        {
            ToTable("local");
            HasKey(l => l.Codigo);
            Property(l => l.Codigo)
                .HasColumnName("codigo")
                .IsRequired()
                .HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.DatabaseGeneratedOption.None);
            Property(l => l.Nombre)
                .HasColumnName("nombre")
                .IsRequired();
            Property(l => l.Direccion)
                .HasColumnName("direccion")
                .IsRequired();
        }
    }
}